package com.ideabove.heart.game;




import android.app.Activity;
import android.content.Intent;
import android.graphics.Canvas;
import android.view.MotionEvent;
import android.view.View;

import com.ideabove.heart.AlarmSetActivity;
import com.ideabove.heart.CallListActivity;
import com.ideabove.heart.MainActivity;
import com.ideabove.heart.ShopActivity;
import com.ideabove.heart.data.Episode;
import com.ideabove.heart.game.framework.GameView;
import com.ideabove.heart.manager.MoeManager;
import com.ideabove.heart.manager.ScheduleManager;
import com.ideabove.heart.util.MyUtil;
import com.ideabove.heart.util.MyUtil.ImageTouch;

public class ShopAfterState extends StoryGirlState{


	public ShopAfterState(GameView gameView, Episode ep){
		super(gameView, ep);
	}
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		// TODO Auto-generated method stub

		MyUtil.touchMe(null, event, new ImageTouch() {

			@Override
			public void touch(View v, MotionEvent event) {
				// TODO Auto-generated method stub
				if(btnConfirm.isBoundary(event)){
					if(backgroundMp != null){
						backgroundMp.stop();
					}
					Intent iAlarm = new Intent(MoeManager.mCurContext, MainActivity.class);			
					iAlarm.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
					MoeManager.mCurContext.startActivity(iAlarm);   
					((Activity)MoeManager.mCurContext).finish();
					MoeManager.setWhatWillIdo(MoeManager.DO_NOTHING);
				}
			}
		});


		return false;
	}

	@Override
	public void Render(Canvas canvas) {
		// TODO Auto-generated method stub
		character.draw(canvas);

//		if(character != null && character.equals(lastCharatcer)){			
			btnConfirm.draw(canvas);
//		}
	}
}
